package com.yupi.springbootinit.model.enums;

public enum TeamStatus {
    //房间公开
    PUBLIC(0, "公开"),
    //房间私有
    PRIVATE(1, "私有"),
    //房间加密
    ENCRYPT(2, "加密");
    public final int code;
    public final String desc;
    TeamStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
public static TeamStatus getByCode(int code) {
        for (TeamStatus status : TeamStatus.values()) {
            if (status.code == code) {
                return status;
            }
        }
        return null;
    }
    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
